﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MVPinWebForms
{
    public partial class _Default : System.Web.UI.Page, IView
    {
        private Presenter _presenter;

        protected void Page_Load(object sender, EventArgs e)
        {
            //if (IsPostBack)
            //{
            //    _presenter.ShowRecords();
            //}
        }


        override protected void OnInit(EventArgs e)
        {
            base.OnInit(e);
            _presenter = new Presenter(this);
            submit.Click += delegate { _presenter.ShowRecords(); };
        }

        public List<string> Records
        {
            set
            {
                GridView1.DataSource = value;
                GridView1.DataBind();
            }
        }
    }
}